class Category < ActiveRecord::Base
  has_and_belongs_to_many :machines
  
  def self.name_size_hash
    @category_size_hash = Hash.new
    for category in self.find(:all, :order =>"name")
      @category_size_hash[category.name] = category.machines.collect{|m|}.size
    end
    return @category_size_hash
  end
end
